﻿<UserControl x:Class="DiagramDesigner.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:s="clr-namespace:DiagramDesigner"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
    mc:Ignorable="d"
    d:DesignHeight="550" d:DesignWidth="750">

    <UserControl.Resources>
        <!-- Designer Item Template-->
        <Style x:Key="DesignerItemStyle" TargetType="ContentControl">
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
            
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate  TargetType="ContentControl">
                        <Grid>
                            <ContentPresenter Content="{TemplateBinding Content}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>

    <Canvas x:Name="main">
        <ContentControl x:Name="path"
            Width="130"
            MinWidth="50"
            Height="130"
            MinHeight="50"
            Canvas.Top="150"
            Canvas.Left="150"
            Style="{StaticResource DesignerItemStyle}" >
            
        	<Path Fill="Blue"
        		Data="M 0,5 5,0 10,5 5,10 Z"
        		Stretch="Fill"
        		IsHitTestVisible="True" />
        </ContentControl>
        
        <ContentControl x:Name="ellipse" Width="130"
                    MinWidth="50"
                    Height="130"
                    MinHeight="50"
                    Canvas.Top="150"
                    Canvas.Left="470"
                    Style="{StaticResource DesignerItemStyle}" >

            <Ellipse Fill="Red" IsHitTestVisible="True" Stretch="Fill"/>
        </ContentControl>
    </Canvas>
</UserControl>
